package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.FpShopSubjectDTO;
import com.financing.wap.dao.IFpShopSubjectDao;
import com.financing.wap.common.SqlName;
/**
 * fp_shop_subject  
 * 店铺题目表 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpShopSubjectDao")
public class FpShopSubjectDaoImpl extends BaseDaoImpl<FpShopSubjectDTO, java.lang.Integer> implements IFpShopSubjectDao {


	@Override
	public int insert(FpShopSubjectDTO fpShopSubject) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.FpShopSubjectSql.insert, fpShopSubject);
	}

	@Override
	public void update(FpShopSubjectDTO fpShopSubject) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpShopSubjectSql.update, fpShopSubject);
	}

	@Override
	public void updateForce(FpShopSubjectDTO fpShopSubject) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpShopSubjectSql.updateForce, fpShopSubject);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.FpShopSubjectSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpShopSubjectDTO> queryList(FpShopSubjectDTO fpShopSubject) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.FpShopSubjectSql.queryList, fpShopSubject);
	}

	@Override
	public int queryListCount(FpShopSubjectDTO fpShopSubject) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.FpShopSubjectSql.queryListCount, fpShopSubject);
	}

	@Override
	public FpShopSubjectDTO loadById(Integer id) throws SQLException {
		return  (FpShopSubjectDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.FpShopSubjectSql.loadById,id);
	}

	@Override
	public Class<FpShopSubjectDTO> getEntityClass() {
		return FpShopSubjectDTO.class;
	}
 	
}
